﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GameRobot;

namespace GameRobotControl
{
    public class SampleManualRobotActionImpl : SampleVirtualRobot
    {
        public SampleManualRobotActionImpl(RobotBridge robotbridge)
        {
            _robotBridge = robotbridge;
        }

        public void ManualAction(GameMessage message)
        {
            switch (message.message)
            {
                case messagedef.MoveAhead:
                    MoveAhead_sd(100.0f);
                    break;
                case messagedef.StopMove:
                    Stop();
                    break;
                //case messagedef.TurnLeft:
                //    Turn_sd(-90);
                //    break;
                //case messagedef.TurnRight:
                //    Turn_sd(90);
                //    break;
            }
        }

        public override void Start()
        {
        }

        public override void Stop()
        {
            GameMessage message = new GameMessage();
            message.message = messagedef.StopAllAction;
            _robotBridge.PushMessageB(message);
        }

        public override void Pause()
        {
        }

        public override void Resume()
        {
        }
    }
}
